var app = getApp();
const requireHttps = app.globalData.requireHttps //获取require域名
Page({
  data: {
    //用户消费明细
    userEarnings:[]
  },
  onLoad: function () {
    let _this = this;
    _this.getUserEarnings();
  },
  //获取用户消费明细
  getUserEarnings: function () {
    let _this = this;
    wx.request({
      url: '' + requireHttps + '/api/member/getUserEarnings',
      data: {
        token: app.globalData.token,
        page: 1
      },
      method: 'post',
      success: res => {
        console.log(res)
        _this.setData({
          userEarnings: res.data.data
        })
      }
    })
  }
})